<?php

//shop管理
Route::group(array('namespace'=>'Admin\Shop','prefix' => 'shop'), function(){

    Route::get('/', 'IndexController@index');

    //brand 品牌管理
    Route::patch('/brand/is_show','BrandController@is_show');
    /*Route::post('/brand/search','BrandController@search');*/
    Route::patch('/brand/sort_order','BrandController@sort_order');
    Route::resource('/brand','BrandController');

    //category 栏目管理
    Route::patch('/goodsCategory/sort_order','goodsCategoryController@sort_order');
    Route::patch('/goodsCategory/is_show','goodsCategoryController@is_show');
    Route::resource('/goodsCategory','goodsCategoryController');


    //product 商品管理
    Route::patch('/product/is_something','ProductController@is_something');
    Route::patch('/product/stock','ProductController@stock');  //ajax修改库存
    Route::delete('/product/destroy_gallery','ProductController@destroy_gallery');

    //删除多选
    Route::delete('/product/destroy_checked','ProductController@destroy_checked');
    Route::get('/product/trash','ProductController@trash'); //显示回收站

    //回收站删除恢复 最后删除
    Route::get('/product/{product}/restore','ProductController@restore'); //回收站恢复单个
    Route::delete('/product/{product}/delete_force','ProductController@delete_force'); //回收站强制删除单个
    Route::get('/product/restore_checked','ProductController@restore_checked'); //回收站恢复多个
    //回收站多选删除没做

    Route::resource('/product','ProductController');

    //customer管理
    Route::get('/customer/index','CustomerController@index');

    //express物流管理
//    Route::get('/express/index','ExpressController@index');
    Route::patch('/express/is_enable','ExpressController@is_enable'); //是否可用
    Route::patch('/express/sort_order','ExpressController@sort_order'); //排序
    Route::resource('/express','ExpressController');  //改为资源路由


    //微信自定义菜单管理
    Route::group(['prefix'=>'wechat'],function(){
        Route::get('/index','WechatController@index'); //测试方法  显示微信菜单http://fangshop.app/shop/wechat/index
        Route::get('/edit','WechatController@edit'); //显示自定义菜单
        Route::put('/update','WechatController@update'); //更新菜单
        Route::delete('/destroy','WechatController@destroy'); //删除所有菜单
    });


    //orders订单管理
    Route::group(['prefix'=>'order'],function(){
        Route::get('/index','OrderController@index');  //显示订单管理首页
        Route::get('/show/{id}','OrderController@show');  //查看订单
        Route::patch('/picking','OrderController@picking');   //配货 修改订单状态
        Route::patch('/shipping','OrderController@shipping'); //修改发货信息
        Route::patch('/finish','OrderController@finish'); //交易成功
    }); 

});
